package main

import (
	"fmt"
	"unsafe"
)

func test() bool {
	fmt.Println("今天天不错")
	return true
}

func main() {
	var i int = 1000
	var j int = 100
	i = i + j
	j = i - j
	i = i - j
	fmt.Println(i, j)
	//var b byte = 109
	//var b byte = 'a'
	var e = '\n' //单引号就是字符常量
	var c_1 uint = 1
	var name string = `name\npjh` + " name" +
		"123"
	name += "pjh"
	var d = false
	var f bool
	var g = int8(i)
	var str string = fmt.Sprintf("%t", f)
	var ptr *bool = &f
	var n1 float64 = 10 / 4
	i++
	i ^= 10
	var huashi = 134.2
	if !(i > 1 && i < 50) {
		fmt.Println("i的值为", i)
	}
	if test() {
		fmt.Println("i的值为", i)

	}
	fmt.Println(&i, ptr, i, n1, c_1)
	fmt.Printf("还有97天放假则还有%d周,%d天", 97/7, 97%7)
	fmt.Println("\n---", 5.0/9*(huashi-100))
	*ptr = true
	fmt.Println(i, name, e, c_1, d, name[1], g, str, &i, ptr, *ptr, i)
	fmt.Printf("第一参数类型 %T 占用的字节数 %d,字符是%c,对应的ascii码位置值%d  参数值为%v", str, unsafe.Sizeof(str), e, e, f)
}
